package com.codi.api.xxljob;

import com.codi.bus.core.service.impl.PortfolioDividentServie;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author lvgo
 * @version 1.0
 * @Description: 设置用户购买的组合基金的分红方式为：红利再投资
 * 每天 20:00 刷新
 * 0 0 20 * * ?
 * @date 18-6-29 下午5:36
 */
@Slf4j
@Component
@JobHandler("refreshPortfolioDividendHandler")
public class RefreshPortfolioDividendHandler extends IJobHandler {
    @Resource
    private PortfolioDividentServie fundBasicJobService;


    @Override
    public ReturnT<String> execute(String param) throws Exception {
        log.info("refresh portfolio dividend ");
        fundBasicJobService.dividentTypeQuery();
        XxlJobLogger.log("RefreshPortfolioDividendHandler, success");
        return SUCCESS;
    }
}
